package cn.pku.sirx.snad.uias.analyzer.similarity;

import org.springframework.util.Assert;

import cn.pku.sirx.snad.uias.model.entity.SiteUser;

/**
 * @author WangXiao
 */
public class GenderAnalyzer implements ISimilarityAnalyzer {

	@Override
	public int analyze(SiteUser fromUser, SiteUser toUser) {
		Assert.notNull(fromUser);
		Assert.notNull(toUser);

		Character fromGender = fromUser.getGender();
		Character toGender = toUser.getGender();
		return fromGender == null ? 0 : (fromGender.equals(toGender) ? 1 : 0);
	}

}
